<%@ Import namespace="MIMS_WRS.Web" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="POList.aspx.vb" Inherits="MIMS_WRS.Web.POList" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<link href="orderlist.css" type="text/css" rel="stylesheet">
			<link href="common.css" type="text/css" rel="stylesheet">
				<script src="orderlist.js" type="text/javascript" language="javascript"></script>
				<script language="javascript">

			var currentIdx = -1;
			var ie = document.all;		
			
			var currentPos = <%=CurrentScrollPos%>;							
			var sort = '<%=RequestContext.SortType%>';
			var selectedItems = new Array();
			var poType = '<%=RequestContext.POType%>';
			
			function remove(rowIdx) {
				for (i = 0; i<selectedItems.length; i++)
					if (selectedItems[i] == rowIdx) {
						selectedItems.splice(i, 1);
						break;
					}
			}
			
			function rowOnClick(e) {
			
				var isCtrl = ie?event.ctrlKey:e.ctrlKey;
				var isShift = ie?event.shiftKey:e.shiftKey;				
				
				selectOne1(this)
				/*
				if (isShift) {
					if (currentIdx > -1)
						selectMulti(this);
				}
				else
					selectOne(this, isCtrl);
				*/	
				if (ie)
					event.returnValue = false;
				else
					e.returnValue = false;
								
				currentIdx = this.rowIndex;	
			
			}	
			
			function rowDoubleClick() {
				var id = this.cells[0].childNodes[0].value;
				
				//RetailPricing.aspx
				var oid = '<%=RequestContext.OfficeID%>';		
				var url = 'RetailPricing.aspx?oid=' + oid + '&id=' + id ;				
				window.location = url;
				
				//openDialog(id, id + ",");
			}
			
			function selectOne1(row) {	
				var tbody = row.parentNode;
				for (i=0; i<selectedItems.length; i++) {																	
					tbody.rows[selectedItems[i]-1].cells[0].childNodes[0].checked = false;						
					tbody.rows[selectedItems[i]-1].className = tbody.rows[selectedItems[i]-1].orgClassName;													
				}	
									
				row.cells[0].childNodes[0].checked = true;								
				
				row.className = "RowSelected";
				selectedItems = new Array();					
				selectedItems[0] = row.rowIndex;	
			}
			function selectOne(row, ctrl) {								
				if (ctrl) {					
					if (row.cells[0].childNodes[0].checked == false) {
						row.className = "RowSelected";												
						row.cells[0].childNodes[0].checked = true;
						selectedItems[selectedItems.length] = row.rowIndex;
					}
					else {											
						row.className = row.orgClassName;											
						row.cells[0].childNodes[0].checked = false;
						remove(row.rowIndex);
					}										
				}
				else {
					
					var tbody = row.parentNode;
					/*
					if (currentIdx > -1) {
						tbody.rows[currentIdx-1].className = tbody.rows[currentIdx-1].orgClassName;
						tbody.rows[currentIdx-1].cells[0].childNodes[0].checked = false;
					}*/
										
					for (i=0; i<selectedItems.length; i++) {																	
						tbody.rows[selectedItems[i]-1].cells[0].childNodes[0].checked = false;						
						tbody.rows[selectedItems[i]-1].className = tbody.rows[selectedItems[i]-1].orgClassName;													
					}	
										
					row.cells[0].childNodes[0].checked = true;								
					
					row.className = "RowSelected";
					selectedItems = new Array();					
					selectedItems[0] = row.rowIndex;										
				}										
			}
			
			function selectMulti(row) {
				var tbl = row.parentNode.parentNode;
				var from, to;
				if (row.rowIndex >= currentIdx) {
					from = currentIdx;
					to = row.rowIndex;				
				} else {
					from = row.rowIndex;
					to = currentIdx;					
				}				
				for (i=from; i<=to; i++) {					
					if (tbl.rows[i].className != "RowSelected") {
						tbl.rows[i].className = "RowSelected";									
						tbl.rows[i].cells[0].childNodes[0].checked = true;
						selectedItems[selectedItems.length] = i;
					}
				}
			}
			
			function newBO() {
				openDialog(0, "");
				return false;
			}
						
			function editMulti() {
				if (checkSelected()) {
					var ids = "";
					var firstId = "";					
					var tbl = window.document.getElementById('tblList');				
					var tbody = tbl.getElementsByTagName('TBODY');							
					tbody = tbody[0];
					for (i=0; i<selectedItems.length; i++) {
						var id = tbody.rows[selectedItems[i]-1].cells[0].childNodes[0].value;						
						ids += id + ",";
						if (firstId == "")
							firstId = id;							
					}
					
					openDialog(firstId, ids);
				}
				return false;
			}
			
			function openDialog(id, ids) {		
				var oid = '<%=RequestContext.OfficeID%>';		
				var url = 'MUKDetail.aspx?oid=' + oid + '&id=' + id + '&ids=' + ids;				
				var height = 710;
				var width = 650;
				var iTop = (screen.height-height-30)/2;
				var iLeft = (screen.width-width)/2;
				window.open(url, '', 'top=' + iTop + ',left=' + iLeft + ',height=' + height + ',width=' + width +',status=yes,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no');				
			}
			
			function gotoSL(id) {
				window.open("navigate1.aspx?sl=" + id);
			}
			
			function gotoBO(sup) {
				window.open("BulkOrderList.aspx?botype=0&sup=" + sup, '_blank', 'location=yes,status=yes, toolbar=yes, menubar=yes, scrollbars=no, resizable=yes, top=0,left=0,width=1000,height=550');
			}
			function checkSelected() {
				/*
				var tbl = window.document.getElementById('tblList');
				var tbody = tbl.getElementsByTagName('TBODY');
				tbody = tbody[0];
				var found = false;
				for (i=0; i<tbody.rows.length; i++) {
					if (tbody.rows[i].cells[0].childNodes[0].value == "1") {
						found = true;
						break;
					}						
				}
				*/				
				if (selectedItems.length > 0)
					return true;
				else {
					alert('Please select items to process');
					return false;
				}
			}
		
			function getListUrl(_sort) {
				var pos = window.document.getElementById('txtScrollPos').value;				
				return "POList.aspx?sort=" + _sort + "&pos=" + pos + "&potype=" + poType;
			}
			
			function sortBy(_sort) {
				window.location.href = getListUrl(_sort);
				return false;
			}
			/*
			function window_onload() {							
				window.document.getElementById('outerDiv').scrollTop = currentPos;				
			}
			function setScrollPos() {
								
				window.status = window.document.getElementById('txtScrollPos').value;
			}
			*/
			var foundElement = null;
			function findTextInCell(text, element) {				
				if (element.innerText) {					
					if (element.innerText.toLowerCase().indexOf(text.toLowerCase()) > -1) {
						foundElement = element;
						return;
					}
				}													
				for (var k=0; k<element.childNodes.length; k++) {
					findTextInCell(text, element.childNodes[k]);
					if (foundElement != null)
						break;
				}				
			}
						
			var highlightCell = null;
			var oldBg = null;
			var lastText = null;
			
			function findTextInGrid() {										
				var text = window.document.getElementById('txtFind').value;				
				var tbl = divContent.childNodes[0];	
				if (text.length == 0) {
					alert('Please enter some text to find');
					return;
				}
				else {
					if (lastText != null) {
						if (lastText != text) { 							
							if (oldBg != null && highlightCell != null) {
								tbl.rows[highlightCell.Y].cells[highlightCell.X].style.background = oldBg;
								tbl.rows[highlightCell.Y];
							}	
							highlightCell = null;
						}
					}					
					lastText = text;
				}
				
				var cellX = 0;
				var cellY = 1;				
				
				if (highlightCell != null) {
					cellX = highlightCell.X+1;
					cellY = highlightCell.Y;						
				}								
				for (var i = cellY; i < tbl.rows.length; i++) {
					for (var j = cellX; j < tbl.rows[i].cells.length; j++) {
						foundElement = null;
						findTextInCell(text, tbl.rows[i].cells[j]);						
						if (foundElement != null) {							
							if (highlightCell == null)
								highlightCell = new Object();
							else {								
								if (oldBg != null) {
									tbl.rows[highlightCell.Y].cells[highlightCell.X].style.background = oldBg;
									tbl.rows[highlightCell.Y];
								}	
							}													
							highlightCell.Y = i;
							highlightCell.X = j;
							oldBg = tbl.rows[i].cells[j].style.background;
							tbl.rows[i].cells[j].style.background = "yellow";	
							tbl.rows[i].cells[j].scrollIntoView(true);
							widthCompensation = tbl.rows[i].cells[j].offsetWidth + 17;
							if (tbl.rows[i].cells[j].offsetLeft + widthCompensation > document.body.clientWidth)
								divContent.scrollLeft = tbl.rows[i].cells[j].offsetLeft - document.body.clientWidth + widthCompensation;
						
							return;							
						}
					}
					cellX = 0;
				}										
				alert('The search has reach the end of the grid and could not find your text!');
				if (highlightCell != null) {
					highlightCell = null;				
				}
			}
			function checkSOValue() {
				if (window.document.getElementById('txtSalesOrder').value != "")
					return true;
				else {
					alert('Please enter Sales Order number before searching');
					return false;
				}
			}
			
			function txtSO_onkeydown() {
				if (event.keyCode == 13) {
					window.document.getElementById('btnSearchSO').click();
					event.returnValue = false;
					return false;
				}
				return true;
			}
			function txtFind_onkeydown() {
				if (event.keyCode == 13) {
					window.document.getElementById('btnFind').click();
					event.returnValue = false;
					return false;
				}
				return true;
			}
			
			
			</script>
	</head>
	<body scroll="no">
		<form id="form1" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"
			runat="server">
			<div id="actionTop">
				<div id="navigation"><a href="../SignIn.aspx?logout=1">Log 
						out</a></div>
				<div id="title">
					<h5><% if RequestContext.POType=0 then %>Incomplete
						<% else if RequestContext.POType=1 then %>
							Completed
						<% else %>
							Archived
						<%end if%>
						<%= RequestContext.OfficeName %>
						P.O. and Container Schedule&nbsp;&nbsp;&nbsp;&nbsp;<asp:dropdownlist id="ddlOffices" runat="server"></asp:dropdownlist>&nbsp;<asp:linkbutton id="lnkSwitchOffice" runat="server">switch</asp:linkbutton>
					</h5>
				</div>
				<div id="sort">
					Sort by:&nbsp;<a onclick="javascript:return sortBy(0);" href="javascript:;">Requisition 
						No.</a>&nbsp;|&nbsp;<a onclick="javascript:return sortBy(1);" href="javascript:;">Order 
						Type</a>&nbsp;|&nbsp;<a onclick="javascript:return sortBy(2);" href="javascript:;">Factory 
						ETD</a>&nbsp;|&nbsp;<a onclick="javascript:return sortBy(3);" href="javascript:;">Customer/Final 
						Destination</a>&nbsp;|&nbsp;<a onclick="javascript:return sortBy(4);" href="javascript:;">ETA</a>&nbsp;|&nbsp;<a onclick="javascript:return sortBy(5);" href="javascript:;">PO 
						Number (Locate Last No)</a>&nbsp;|&nbsp;<a onclick="javascript:return sortBy(6);" href="javascript:;">Container 
						Delivered Date</a>&nbsp;|&nbsp;<a onclick="javascript:return sortBy(7);" href="javascript:;">Customer 
						- Proforma Invoice No</a>&nbsp;|&nbsp;<a onclick="javascript:return sortBy(8);" href="javascript:;">Consolidation 
						Points - Requisition No</a>&nbsp;|&nbsp;<a onclick="javascript:return sortBy(9);" href="javascript:;">Sales Order - Requisition No</a>
						&nbsp;|&nbsp;<a onclick="javascript:return sortBy(10);" href="javascript:;">S Invoice No - Req. No - Primary</a>
						&nbsp;|&nbsp;<a onclick="javascript:return sortBy(11);" href="javascript:;">Customer - S Invoice No - Req. No - Primary</a>&nbsp;&nbsp;&nbsp;<br>
					Current Sorting:&nbsp;<asp:label id="lblSorting" runat="server" cssclass="CurrentSort" enableviewstate="False">Requisition No. - Primary</asp:label>
				</div>
				<div id="actionButtons">
					
						</div>
				<div id="find"><b>Container Tag No:</b>
					<asp:textbox id="txtSalesOrder" runat="server" size="10" onkeydown="txtSO_onkeydown()"></asp:textbox><asp:button runat="server" id="btnSearchSO" class="Button" text="Search"></asp:button>&nbsp;|&nbsp;find 
					on this page<input type="text" size="15" id="txtFind" onkeydown="txtFind_onkeydown()">&nbsp;<input type="button" id="btnFind" onclick="findTextInGrid()" value="Find" class="Button"></div>
				<div id="legend">
					Column Indicators:
					<span class="All">All</span>&nbsp;&nbsp;<span class="Officer">Office</span>&nbsp;&nbsp;<span class="Supplier">Factory</span>&nbsp;&nbsp;&nbsp;&nbsp;Row 
					Indicators:&nbsp;<span class="ThisWeek">Modified this week</span>&nbsp;&nbsp;<span class="LastWeek">Modified last week</span>&nbsp;&nbsp;Older 
					items
				</div>
				<asp:literal id="ltrSOSearchStatus" runat="server"></asp:literal>
				<div  id="legend1">
					<span >Double click on Purchase Order row to setup Retail Price</span>
				</div>
			</div>
			
			<div id="outerDiv">
				<div id="innerDiv">					
					<asp:repeater id="rptList" runat="server" enableviewstate="False">
						<headertemplate>
							<table id="tblList">
								<thead>
									<tr>
										<th>
											<div class="ReqCell All"><span>
											Req
											<% if RequestContext.SortType <> EPOAndContainerScheduleSorting.PONumber then %>
											<img src="../Images/up.gif"><%end if%></span></div>
										</th>
										<th class="SalesOrderCell All">
											Cont. Tag<% if RequestContext.SortType = EPOAndContainerScheduleSorting.SalesOrderRequisitionNo then %>
											<img src="../Images/up.gif"><%end if%></th>
										<th class="OrderDateCell All">
											Order Date</th>
										<th class="BulkCell All">
											Bulk</th>
										<th class="SizeCell All">
											Size</th>
										<th class="PackCell All">
											Pack</th>
										<th>
											<div class="OrderTypeCell All"><span>
												Type
												<% if RequestContext.SortType = EPOAndContainerScheduleSorting.OrderType then %>
												<img src="../Images/up.gif"><%end if%></span></div>
										</th>
										<th>
											<div class="SuppCell All"><span>
												Supp
												<% if RequestContext.SortType = EPOAndContainerScheduleSorting.OrderType OR  RequestContext.SortType = EPOAndContainerScheduleSorting.PONumber then %>
												<img src="../Images/up.gif"><%end if%></span></div>
										</th>
										<th>
											<div class="ONoCell All"><span>
												O/No
												<% if RequestContext.SortType = EPOAndContainerScheduleSorting.PONumber then %>
												<img src="../Images/up.gif"><%end if%></span></div>
										</th>
										<th>
											<div class="PriCell All"><span>Primary <% if RequestContext.SortType <> EPOAndContainerScheduleSorting.PONumber then %><img src="../Images/up.gif"><%end if%></span></div>
										</th>
										<th class="ConCell All">
											Con</th>
										<th class="ConPointCell All">
											Con Point<% if RequestContext.SortType = EPOAndContainerScheduleSorting.ConPointRequisitionNo then %>
											<img src="../Images/up.gif"><%end if%></th>
										<th class="CusCell Officer">
											Respon.
										</th>
										<th class="POInOperaCell Officer">
											PO In Opera
										</th>
										<th class="PISCCell Officer">
											PI/SC<% if RequestContext.SortType = EPOAndContainerScheduleSorting.CustomerProformaInvoiceNo then %>
											<img src="../Images/up.gif"><%end if%></th>
										<th class="AccNoCell Officer">
											Acc No</th>
										<th>
											<div class="CusCell Officer"><span>
												Customer
												<% if RequestContext.SortType = EPOAndContainerScheduleSorting.CustomerOrLocation Or RequestContext.SortType = EPOAndContainerScheduleSorting.CustomerProformaInvoiceNo Or RequestContext.SortType = EPOAndContainerScheduleSorting.CustomerSInvoiceNoReqNoPrimary  then %>
												<img src="../Images/up.gif"><%end if%></span></div>
										</th>
										<th class="CustPONoCell Officer">											
												Cust PO No
												<% if RequestContext.SortType = EPOAndContainerScheduleSorting.CustomerOrLocation then %>
												<img src="../Images/up.gif"><%end if%>
										</th>
										<th>
											<div class="FinalDestCell Officer"><span>
												Final Destination
												<% if RequestContext.SortType = EPOAndContainerScheduleSorting.CustomerOrLocation then %>
												<img src="../Images/up.gif"><%end if%></span></div>
										</th>
										<th class="ArriPortCell Officer">
											Arrival Port</th>
										<th class="DescCell All">
											Description</th>
										<th class="OnHoldCell All">
											Lag Days</th>
										<th class="FacETDCell Supplier">											
												Factory ETD
												<% if RequestContext.SortType = EPOAndContainerScheduleSorting.FactoryETD then %>
												<img src="../Images/up.gif"><%end if%>
										</th>
										<th class="TrgETDCell All">
											Target ETD</th>
										<th class="OnHoldCell Supplier">
											On Hold</th>
										<th class="ShiDateCell Supplier">
											Shipped Date</th>
										<th class="OnHoldCell Supplier">
											Nom Ship</th>
										<th class="ShiLineCell Supplier">
											Est/Act</th>
										<th class="ShiLineCell Supplier">
											Shipping Line</th>
										<th class="VesCell Supplier">
											Feeder Vessel</th>
										<th class="VesCell Supplier">
											Mother Vessel</th>
										<th class="ConNoCell Supplier">
											Container No</th>
										<th class="ETACell Supplier">											
												ETA
												<% if RequestContext.SortType = EPOAndContainerScheduleSorting.ETA then %>
												<img src="../Images/up.gif"><%end if%>
										</th>
										<th class="WkCell Supplier">
											Wk</th>
										<th class="ConDelCell Officer">											
												Cont Del
												<% if RequestContext.SortType = EPOAndContainerScheduleSorting.ContainerDeliveredDate then %>
												<img src="../Images/up.gif"><%end if%>
										</th>
										<% If (MIMS_WRS.Web.Security.IsAdmin = True) Then %>
										<th class="PayAuthCell Officer">
											Pay Auth</th>
										<% End If %>
										<th class="PPaymentCell Officer">
											P Payment</th>
										<th class="PDepCell Officer">
											P Dep Value</th>
										<th class="PInvCell Officer">
											P Inv Value</th>
										<th class="PPayDateCell Officer">
											P Pay Date</th>
										<th class="DocRecCell Officer">
											Doc Recv.</th>
										<th class="CompCell Officer">
											Completed</th>
										<th class="SInvCell Officer">
											S Invoice No<% if RequestContext.SortType = EPOAndContainerScheduleSorting.SInvoiceNoReqNoPrimary Or RequestContext.SortType = EPOAndContainerScheduleSorting.CustomerSInvoiceNoReqNoPrimary then %>
												<img src="../Images/up.gif"><%end if%></th>
										<th class="SInvValueCell Officer">
											S Invoice Value</th>
										<th class="SInvDateCell Officer">
											S Invoice Date</th>
										<th class="SPaymentDueCell Officer">
											S Payment Due</th>
										<th class="SInvPaidCell Officer">
											S Invoice Paid</th>
										<th class="DebtorDaysCell Officer">
											Debtor Days</th>
										<th class="ExtraCreditDaysCell Officer">
											Extra Credit Days</th>
										<th class="LeadDaysCell Officer">
											Lead Days</th>
										<th class="SuppONoCell Officer">
											Supp.O/No</th>
									</tr>
								</thead><tbody>
						</headertemplate>
						<itemtemplate>
							<tr class="<%# GetRowClass(Container) %>">
								<td class="NonTextType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><input id=chkSelect name=chkSelect type=checkbox style="visibility: hidden;display: none" value='<%# DataBinder.Eval(Container.DataItem, "ID") %>'><%# Convert.ToString(DataBinder.Eval(Container.DataItem, "REQ")).PadLeft(4, "0"c)%>
								</td>
								<td class="NonTextType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# Utilities.GetNormalText(DataBinder.Eval(Container.DataItem, "SalesOrder")).PadLeft(5, "0"c)%>
								</td>
								<td class="DateType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetDateText(DataBinder.Eval(Container.DataItem, "OrderDate")) %>
								</td>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetBulkText(DataBinder.Eval(Container.DataItem, "BulkType")) %>
								</td>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetNullText(DataBinder.Eval(Container.DataItem, "ContainerSize")) %>
								</td>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetPackText(DataBinder.Eval(Container.DataItem, "LP")) %>
								</td>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetTypeText(DataBinder.Eval(Container.DataItem, "PONo_Type")) %>
								</td>
								<td class="NonTextType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %> "><asp:literal id=ltrSupplierNo runat=server text='<%# GetNullText(DataBinder.Eval(Container.DataItem, "PONo_Supplier")).PadLeft(3, "0"c) %>'></asp:Literal>
								</td>
								<td class="NonTextType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %> "><asp:Literal ID=ltrPONo Runat=server Text='<%# GetNullText(DataBinder.Eval(Container.DataItem, "PONo_Number")).PadLeft(3, "0"c) %>'></asp:literal>
								</td>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetPrimaryText(DataBinder.Eval(Container.DataItem, "IsPrimary")) %>
								</td>
								<td class="NonTextType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetConText(DataBinder.Eval(Container.DataItem, "PONo_Consolidation")) %>
								</td>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetNullText(DataBinder.Eval(Container.DataItem, "ConPoint")) %>
								</td>
								<td  class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetNullText(DataBinder.Eval(Container.DataItem, "Responsible")) %>
								</td>
								<td  class="DateType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetDateText(DataBinder.Eval(Container.DataItem, "POInOpera")) %>
								</td>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetNullText(DataBinder.Eval(Container.DataItem, "PI")) %>
								</td>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetNullText(DataBinder.Eval(Container.DataItem, "AccNo")) %>
								</td>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetNullText(DataBinder.Eval(Container.DataItem, "CustomerOrLocation")) %>
								</td>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetNullText(DataBinder.Eval(Container.DataItem, "CustPONo")) %>
								</td>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetNullText(DataBinder.Eval(Container.DataItem, "FinalDestination")) %>
								</td>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetNullText(DataBinder.Eval(Container.DataItem, "ArrivalPort")) %>
								</td>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><div class="DescriptionCell"><span><%# GetNullText(DataBinder.Eval(Container.DataItem, "Description")) %></span></div>
								</td>
								<td class="NonTextType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetNullText(DataBinder.Eval(Container.DataItem, "LagDays")) %>
								</td>
								<td class="DateType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetDateText(DataBinder.Eval(Container.DataItem, "FactoryETD")) %>
								</td>
								<td class="DateType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetDateText(DataBinder.Eval(Container.DataItem, "TargetETD")) %>
								</td>
								<td class="NonTextType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetCheckText(DataBinder.Eval(Container.DataItem, "OnHold")) %>
								</td>
								<td class="DateType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %> <%# GetShippedDateClass(Container) %>"><%# GetDateText(DataBinder.Eval(Container.DataItem, "ShippingDate")) %>
								</td>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetNomShip(DataBinder.Eval(Container.DataItem, "IsNomShip")) %>
								</td>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %> <%# GetEstOrActClass(Container) %>" ><%# GetEstOrActText(Container) %>
								</td>
								<td class="NonTextType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %> <%# GetEstOrActClass(Container) %>" ><%# GetShippingLineText(Container) %></td>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %> <%# GetEstOrActClass(Container) %>" ><%# GetNullText(DataBinder.Eval(Container.DataItem, "FeederVessel")) %>
								</td>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %> <%# GetEstOrActClass(Container) %>" ><%# GetNullText(DataBinder.Eval(Container.DataItem, "Vessel")) %>
								</td>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetNullText(DataBinder.Eval(Container.DataItem, "ContainerNo")) %>
								</td>
								<td class="DateType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %> <%# GetEstOrActClass(Container) %>" ><%# GetDateText(DataBinder.Eval(Container.DataItem, "ETA")) %>
								</td>
								<td class="DateType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %> <%# GetEstOrActClass(Container) %>" ><%# GetNullText(DataBinder.Eval(Container.DataItem, "Week"))  %>
								</td>
								<td  class="DateType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetDateText(DataBinder.Eval(Container.DataItem, "ContainerDeliveried")) %>
								</td>
								<% If (MIMS_WRS.Web.Security.IsAdmin = True) Then %>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetNullText(DataBinder.Eval(Container.DataItem, "PayAuth")) %>
								</td>
								<% End If %>
								<td class="<%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetPaymentText(DataBinder.Eval(Container.DataItem, "Payment")) %>
								</td>
								<td class="NumericType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetMoneyText(DataBinder.Eval(Container.DataItem, "PDepValue")) %>
								</td>
								<td class="NumericType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetMoneyText(DataBinder.Eval(Container.DataItem, "InvValue")) %>
								</td>
								<td  class="DateType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetDateText(DataBinder.Eval(Container.DataItem, "PayDate")) %>
								</td>
								<td class="NonTextType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetCheckText(DataBinder.Eval(Container.DataItem, "DocReceived")) %>
								</td>
								<td class="DateType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetDateText(DataBinder.Eval(Container.DataItem, "CompletedDate")) %>
								</td>
								<td class="NumericType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetNullText(DataBinder.Eval(Container.DataItem, "SInvoiced")) %>
								</td>
								<td class="NumericType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# Utilities.GetDecimalText(DataBinder.Eval(Container.DataItem, "SalesInvoiceValue")) %>
								</td>
								<td class="DateType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# Utilities.GetDateText(DataBinder.Eval(Container.DataItem, "SalesInvoiceDate")) %>
								</td>
								<td class="DateType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# Utilities.GetDateText(DataBinder.Eval(Container.DataItem, "SalesPaymentDue")) %>
								</td>
								<td class="DateType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %> <%# GetSInvoicePdClass(Container)%>"><%# GetDateText(DataBinder.Eval(Container.DataItem, "SInvoicedPd")) %>
								</td>
								<td class="NumericType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# CalculateDebtorDays(Container) %>
								</td>
								<td class="NumericType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# CalculateExtraCreditDays(Container) %>
								</td>								
								<td class="NumericType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# CalculateLeadDays(Container) %>
								</td>
								<td class="NonTextType <%# GetSameReqClass(Container) %> <%# GetModifiedClass(Container) %>"><%# GetNullText(DataBinder.Eval(Container.DataItem, "SuppOrderNo")) %>
								</td>
							</tr>
						</itemtemplate>
						<footertemplate>
							</tbody></table>
						</footertemplate>
					</asp:repeater>
				</div>
			</div>
			<script language="javascript">	
				CreateScrollHeader(document.getElementById("innerDiv"), true, false);
				//setTimeout("initTable()", 200);
												
				function disabletext(e){
					return false;
				}

				function reEnable(){
					return true;
				}
				
				function selectStart() {
					return false;
				}			
				
				
				if (ie)	
					divContent.onselectstart = selectStart;
				else if (window.sidebar){
					document.onmousedown=disabletext;
					document.onclick=reEnable;
				}
												
				//setTimeout("window_onload()", 100);	
				//setTimeout("test()", 200);		
				
			</script>
		</form>
		<input id="btnRefresh" style="DISPLAY: none" onclick="window.location.replace(getListUrl(sort))"
			type="button"> <input id="txtScrollPos" type="hidden">
	</body>
</html>
